post_install() {
  XDG_DATA_DIRS=/mingw64/share mingw64/bin/update-mime-database mingw64/share/mime > /dev/null 2>&1
}

post_upgrade() {
  post_install
}

post_remove() {
  if [ -d mingw64/share/mime ]; then
    rm -f mingw64/share/mime/{globs,globs2,icons,treemagic,generic-icons,types,magic,XMLnamespaces,subclasses,aliases,mime.cache}
    rm -rf mingw64/share/mime/{application,audio,image,inode,message,model,multipart,text,video,x-content,x-epoc}
    rmdir --ignore-fail-on-non-empty mingw64/share/mime
  fi
}
